NODE_TYPE_ITEM = 1
NODE_TYPE_EXPANDITEM = 0
require 'rubygems'
require 'wx'
require 'libs/utilities/main/muidecode' # mush soft code style meta lanaguage to run from ctrl+s
require 'libs/gui/main/ilf' # interact between server and local databases
require 'libs/gui/main/projedit' # project management
require 'libs/gui/main/yamledit' # yaml cfg file editor viewr
require '/home/ppibburr/muide1/libs/utilities/main/projectlib.rb' # local Object and Project classes
require '/home/ppibburr/muide1/libs/utilities/main/serverdata.rb' # server cfg class
require '/home/ppibburr/muide1/libs/utilities/main/history' # history managment for editor and mu* server inpt
require '/home/ppibburr/muide1/libs/utilities/main/connector'  # the connector class, handle a connection and store data between the ui to backend
# require '/home/ppibburr/muide1/libs/gui/main/loginstring.rb'
require '/home/ppibburr/muide1/libs/gui/main/serverinterface.rb' # the mu* client
require '/home/ppibburr/muide1/libs/gui/main/extensionsLib.rb' # handle extensions (plugins)
require '/home/ppibburr/muide1/libs/gui/main/styled.rb' # a base or wxRIDE's editor
require '/home/ppibburr/muide1/libs/gui/main/EditorPage.rb' # wxRIDE's scintila editor
require '/home/ppibburr/muide1/libs/gui/main/listctrl' # custom list_ctrlfor virtual tree 
require '/home/ppibburr/muide1/libs/gui/main/node' # nodes for custom tree  list
require '/home/ppibburr/muide1/libs/gui/main/virtualtree' # custom tree list ctrl
require '/home/ppibburr/muide1/libs/gui/main/objectviewer' # object viewr using custm virtual tree
# require '/home/ppibburr/muide1/libs/gui/main/gui' 
require '/home/ppibburr/muide1/libs/defs/client/defs' # helper and ui methods
require '/home/ppibburr/muide1/libs/utilities/main/colors' # ansi colours
require '/home/ppibburr/muide1/libs/utilities/main/metaserver' # Mu server io and Backend to access rubyMu* bindings
require '/home/ppibburr/muide1/libs/utilities/main/ansi' # handle ansi formatting to display in mu server output
require 'libs/gui/main/interface_classes' # ui ctrls, proj tree, mu sever i/o ctrls
require 'libs/utilities/main/mucode' # mush code tokenizer, formatter and deformatter
require 'libs/gui/main/panematrix'
#####################################################################################################
VERSION = "0.1-build-Charlie"

$projects = {}

# dummy class
class Foo
  def give l,x,y
    print l
  end
end
####
begin
######################################################################################################
require 'libs/gui/main/main.rb' # aui frame, aui events and aui methods
######################################################################################################
rescue => e
	err = "Error: #{e.to_s}\n"
	err += "Platform: #{Wx::PLATFORM}\n"
	err += "MuIDE Version: #{VERSION}\n"
	err += "Ruby Version: #{RUBY_VERSION}\n"
	err += "Backtrace:\n\t"
	err += e.backtrace.join("\n\t")
        efile = "errors/#{Time.now.to_s}_fatalMuIDE.err"
	File.open(File.join(Dir.getwd,"#{efile}"),"w") do |fh|
		fh.print(err)
	end
puts err
        File::open("#{$logfile}","a") {|f|
          f.puts "\n #{Time.now.to_s} : Fatal Error, description in #{Dir.getwd}/#{efile}"
        }
	#dir = File.dirname(File.expand_path(__FILE__))
	if Wx::PLATFORM == "WXMSW"
		Kernel.exec("rubyw #{Dir.getwd}\\libs\\gui\\main\\wxFatalError.rb")
	else
		Kernel.exec("ruby libs//gui//main//wxFatalError.rb '#{Dir.getwd}/#{efile}'")
	end
end



__END__
MuIDE version 0.02 by PpiBbuRr<br><br>
A Mu* Client, a Mu* IDE and rubyMu* bindings and more.<br>
<br>Features:<pre>
* Front End to the rubyMu* library, almost every thing pertaining to Mu* has a ruby class. 
* Can eval code from the terminal (if started in one) and several text fields.
* Mu* Client (many plugins to enhance it).
* Intergrated Development Enviroment for Mu*'s utilizing the back-end.
     - Project management
     - Mu* Code Editor with formatting, unformatting and syntax hilighting.
* Offline and Server database management. Can convert a server object to a offline database file and back to a server object.
     - convert between many Mu* types using this feature.
* Ruby Editor that can load files save them and evaluate code in the ide. 
* Html help system and HTML File viewer.
* Smart error catching.
</pre>
